{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Imports\n",
    "\n",
    "Import all the modules and functionalities we need."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib inline\n",
    "\n",
    "# Import standard libraries.\n",
    "import os\n",
    "\n",
    "# Import third party libraries.\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import seaborn as sns\n",
    "from statsmodels.stats.multitest import multipletests\n",
    "\n",
    "# Import custom libraries/scripts.\n",
    "import annotations\n",
    "import helpers"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Loading data\n",
    "\n",
    "Fetch all our relevant data for the current analysis."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set working contants.\n",
    "EXPERIMENTS_PATH = r'D:\\Miguel\\PhD\\Results\\Competition\\DL\\small_arenas\\Or47b\\crossed_with_white_minus\\processed'\n",
    "FPS = 60\n",
    "N_MINUTES = 5\n",
    "N_FRAMES = N_MINUTES * 60 * FPS # First five minutes of copulation.\n",
    "INK = 'black'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Set figure configurations.\n",
    "sns.set(\n",
    "        context='paper',\n",
    "        style='ticks',\n",
    "        font='sans-serif',\n",
    "        font_scale=1.0, \n",
    "        rc={\n",
    "            'axes.axisbelow': True,\n",
    "            'axes.edgecolor': INK,\n",
    "            'axes.facecolor': 'white' if INK=='black' else 'black',\n",
    "            'axes.grid': False,\n",
    "            'axes.labelcolor': INK,\n",
    "            'axes.labelsize': 13.0,\n",
    "            'axes.labelweight': 'normal',\n",
    "            'axes.linewidth': 1.0,\n",
    "            'axes.spines.left': True,\n",
    "            'axes.spines.bottom': True,\n",
    "            'axes.spines.top': False,\n",
    "            'axes.spines.right': False,\n",
    "            'axes.titlepad': 15.0,\n",
    "            'axes.titlesize': 20.0,\n",
    "            'axes.titleweight': 'bold',\n",
    "            'figure.facecolor': 'white' if INK=='black' else 'black',\n",
    "            'figure.figsize': [4.0, 4.0],\n",
    "            'figure.titlesize': 30.0,\n",
    "            'figure.titleweight': 'bold',\n",
    "            'font.family': ['sans-serif'],\n",
    "            'font.sans-serif': ['Arial'],\n",
    "            'legend.frameon': False,\n",
    "            'legend.fontsize': 11.0,\n",
    "            'lines.color': INK,\n",
    "            'lines.linewidth': 1.0,\n",
    "            'patch.edgecolor': INK,\n",
    "            'savefig.dpi': 300,\n",
    "            'savefig.format': 'png',\n",
    "            'savefig.bbox': 'tight',\n",
    "            'savefig.transparent': True,\n",
    "            'text.color': INK,\n",
    "            'text.usetex': False,\n",
    "            'xtick.color': INK,\n",
    "            'xtick.direction': 'out',\n",
    "            'xtick.labelsize': 12.0,\n",
    "            'xtick.major.pad': 5.0,\n",
    "            'xtick.major.size': 0.0,\n",
    "            'xtick.major.width': 1.0,\n",
    "            'xtick.minor.size': 0.0,\n",
    "            'xtick.minor.width': 0.4,\n",
    "            'ytick.color': INK,\n",
    "            'ytick.direction': 'out',\n",
    "            'ytick.labelsize': 12.0,\n",
    "            'ytick.major.pad': 5.0,\n",
    "            'ytick.major.size': 3.0,\n",
    "            'ytick.major.width': 1.0,\n",
    "            'ytick.minor.size': 0.0,\n",
    "            'ytick.minor.width': 0.4\n",
    "           }\n",
    "       )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Folder already exists, skipping.\n"
     ]
    }
   ],
   "source": [
    "# Prepare the Figures folder to save our graphs in.\n",
    "savepath = os.path.join(r'C:\\Users\\Miguel\\Desktop\\paper_data', 'paper_figures', 'figureS3')\n",
    "try:\n",
    "    os.makedirs(savepath)\n",
    "    print(\"New folder created.\")\n",
    "except FileExistsError:\n",
    "    print(\"Folder already exists, skipping.\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Paths to conditions:\n",
      " ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control', '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test', '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control']\n"
     ]
    }
   ],
   "source": [
    "# Set the conditions to analyze.\n",
    "condition_order = ['gal4_control', 'uas_control', 'test']\n",
    "conditions = [item.path for item in os.scandir(EXPERIMENTS_PATH) if item.name in condition_order]\n",
    "print('Paths to conditions:\\n', conditions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\t\n",
      " gal4_control\n",
      "\t\n",
      " test\n",
      "Copulation too short: video_2021-02-16T10_30_25_arena11.csv\n",
      "\t\n",
      " uas_control\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'gal4_control': ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T11_52_18_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T11_52_18_arena4.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T11_52_18_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T11_52_18_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T12_31_46_arena4.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T12_31_46_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-15T12_31_46_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T10_30_25_arena1.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T10_30_25_arena10.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T10_30_25_arena16.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T10_30_25_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T11_24_30_arena1.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T11_24_30_arena16.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T11_24_30_arena4.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T11_24_30_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-16T11_24_30_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T11_53_24_arena1.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T11_53_24_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T11_53_24_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T11_53_24_arena4.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T11_53_24_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T12_30_11_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T12_30_11_arena13.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T12_30_11_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T12_30_11_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-17T12_30_11_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena10.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena13.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena16.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena4.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena5.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-18T10_30_35_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-19T12_26_51_arena11.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-19T12_26_51_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-19T12_26_51_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\gal4_control\\\\video_2021-02-19T12_26_51_arena8.csv'],\n",
       " 'uas_control': ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-15T11_52_18_arena14.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-15T11_52_18_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-15T12_31_46_arena11.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-15T12_31_46_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T10_30_25_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T10_30_25_arena13.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T10_30_25_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T10_30_25_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T11_24_30_arena11.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T11_24_30_arena14.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T11_24_30_arena5.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-16T11_24_30_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T11_53_24_arena10.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T11_53_24_arena13.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T11_53_24_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T12_30_11_arena1.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T12_30_11_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-17T12_30_11_arena16.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-18T10_30_35_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-18T10_30_35_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-19T12_26_51_arena2.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\uas_control\\\\video_2021-02-19T12_26_51_arena5.csv'],\n",
       " 'test': ['\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T11_52_18_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T11_52_18_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T11_52_18_arena5.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T11_52_18_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T12_31_46_arena10.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T12_31_46_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T12_31_46_arena2.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-15T12_31_46_arena8.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T10_30_25_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T10_30_25_arena2.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T10_30_25_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T11_24_30_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T11_24_30_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-16T11_24_30_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T11_53_24_arena14.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T11_53_24_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T11_53_24_arena5.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T11_53_24_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T11_53_24_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T12_30_11_arena11.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T12_30_11_arena2.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T12_30_11_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-17T12_30_11_arena9.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-18T10_30_35_arena11.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-18T10_30_35_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-18T10_30_35_arena15.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-18T10_30_35_arena2.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-18T10_30_35_arena6.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena1.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena10.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena12.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena16.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena3.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena7.csv',\n",
       "  '\\\\\\\\10.40.12.80\\\\home\\\\PhD\\\\Results\\\\Competition\\\\DL\\\\small_arenas\\\\Or47b\\\\crossed_with_white_minus\\\\processed\\\\test\\\\video_2021-02-19T12_26_51_arena9.csv']}"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Load all usable experiments for each condition.\n",
    "experiments = {condition: [] for condition in condition_order}\n",
    "\n",
    "for condition_path in conditions:\n",
    "    \n",
    "    condition = os.path.basename(condition_path)\n",
    "    print('\\t\\n', condition)\n",
    "    \n",
    "    for item in os.scandir(condition_path):\n",
    "        if item.name.endswith('.csv'):\n",
    "            \n",
    "            annotation_video = annotations.read(item.path)\n",
    "\n",
    "            try:\n",
    "                copulation = annotation_video[0].events[0]\n",
    "                copulation_duration = copulation.duration\n",
    "\n",
    "                # Filter out videos where copulation is interrupted.\n",
    "                copulation_end = copulation.time_interval[1]\n",
    "                if copulation_end==N_FRAMES:\n",
    "                    if copulatio.duration < 5 * 60 * FPS:\n",
    "                        print('Copulation interrupted:', item.name)\n",
    "                        continue\n",
    "\n",
    "                # Filter out videos where copulation lasts less than 8 minutes.\n",
    "                if copulation_duration <= 8 * 60 * FPS:\n",
    "                    print('Copulation too short:', item.name)\n",
    "                    continue\n",
    "            \n",
    "            except IndexError:\n",
    "                continue\n",
    "            \n",
    "            experiments[condition].append(item.path)\n",
    "\n",
    "experiments"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Aggression Analysis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Iteration: 0 \n",
      "Experiment: video_2021-02-15T11_52_18_arena3.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 1 \n",
      "Experiment: video_2021-02-15T11_52_18_arena4.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 2 \n",
      "Experiment: video_2021-02-15T11_52_18_arena6.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 3 \n",
      "Experiment: video_2021-02-15T11_52_18_arena8.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 4 \n",
      "Experiment: video_2021-02-15T12_31_46_arena4.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 5 \n",
      "Experiment: video_2021-02-15T12_31_46_arena7.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 6 \n",
      "Experiment: video_2021-02-15T12_31_46_arena9.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 7 \n",
      "Experiment: video_2021-02-16T10_30_25_arena1.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 8 \n",
      "Experiment: video_2021-02-16T10_30_25_arena10.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 9 \n",
      "Experiment: video_2021-02-16T10_30_25_arena16.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 10 \n",
      "Experiment: video_2021-02-16T10_30_25_arena7.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 11 \n",
      "Experiment: video_2021-02-16T11_24_30_arena1.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 12 \n",
      "Experiment: video_2021-02-16T11_24_30_arena16.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 13 \n",
      "Experiment: video_2021-02-16T11_24_30_arena4.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 14 \n",
      "Experiment: video_2021-02-16T11_24_30_arena7.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 15 \n",
      "Experiment: video_2021-02-16T11_24_30_arena9.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 16 \n",
      "Experiment: video_2021-02-17T11_53_24_arena1.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 17 \n",
      "Experiment: video_2021-02-17T11_53_24_arena12.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 18 \n",
      "Experiment: video_2021-02-17T11_53_24_arena15.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 19 \n",
      "Experiment: video_2021-02-17T11_53_24_arena4.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 20 \n",
      "Experiment: video_2021-02-17T11_53_24_arena6.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 21 \n",
      "Experiment: video_2021-02-17T12_30_11_arena12.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 22 \n",
      "Experiment: video_2021-02-17T12_30_11_arena13.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 23 \n",
      "Experiment: video_2021-02-17T12_30_11_arena6.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 24 \n",
      "Experiment: video_2021-02-17T12_30_11_arena7.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 25 \n",
      "Experiment: video_2021-02-17T12_30_11_arena8.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 26 \n",
      "Experiment: video_2021-02-18T10_30_35_arena10.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 27 \n",
      "Experiment: video_2021-02-18T10_30_35_arena13.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 28 \n",
      "Experiment: video_2021-02-18T10_30_35_arena16.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 29 \n",
      "Experiment: video_2021-02-18T10_30_35_arena4.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 30 \n",
      "Experiment: video_2021-02-18T10_30_35_arena5.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 31 \n",
      "Experiment: video_2021-02-18T10_30_35_arena8.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 32 \n",
      "Experiment: video_2021-02-19T12_26_51_arena11.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 33 \n",
      "Experiment: video_2021-02-19T12_26_51_arena15.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 34 \n",
      "Experiment: video_2021-02-19T12_26_51_arena6.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 35 \n",
      "Experiment: video_2021-02-19T12_26_51_arena8.csv \n",
      "Condition: gal4_control \n",
      "\n",
      "Iteration: 0 \n",
      "Experiment: video_2021-02-15T11_52_18_arena14.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 1 \n",
      "Experiment: video_2021-02-15T11_52_18_arena9.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 2 \n",
      "Experiment: video_2021-02-15T12_31_46_arena11.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 3 \n",
      "Experiment: video_2021-02-15T12_31_46_arena3.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 4 \n",
      "Experiment: video_2021-02-16T10_30_25_arena12.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 5 \n",
      "Experiment: video_2021-02-16T10_30_25_arena13.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 6 \n",
      "Experiment: video_2021-02-16T10_30_25_arena3.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 7 \n",
      "Experiment: video_2021-02-16T10_30_25_arena8.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 8 \n",
      "Experiment: video_2021-02-16T11_24_30_arena11.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 9 \n",
      "Experiment: video_2021-02-16T11_24_30_arena14.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 10 \n",
      "Experiment: video_2021-02-16T11_24_30_arena5.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 11 \n",
      "Experiment: video_2021-02-16T11_24_30_arena8.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 12 \n",
      "Experiment: video_2021-02-17T11_53_24_arena10.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 13 \n",
      "Experiment: video_2021-02-17T11_53_24_arena13.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 14 \n",
      "Experiment: video_2021-02-17T11_53_24_arena8.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 15 \n",
      "Experiment: video_2021-02-17T12_30_11_arena1.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 16 \n",
      "Experiment: video_2021-02-17T12_30_11_arena15.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 17 \n",
      "Experiment: video_2021-02-17T12_30_11_arena16.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 18 \n",
      "Experiment: video_2021-02-18T10_30_35_arena7.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 19 \n",
      "Experiment: video_2021-02-18T10_30_35_arena9.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 20 \n",
      "Experiment: video_2021-02-19T12_26_51_arena2.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 21 \n",
      "Experiment: video_2021-02-19T12_26_51_arena5.csv \n",
      "Condition: uas_control \n",
      "\n",
      "Iteration: 0 \n",
      "Experiment: video_2021-02-15T11_52_18_arena12.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 1 \n",
      "Experiment: video_2021-02-15T11_52_18_arena15.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 2 \n",
      "Experiment: video_2021-02-15T11_52_18_arena5.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 3 \n",
      "Experiment: video_2021-02-15T11_52_18_arena7.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 4 \n",
      "Experiment: video_2021-02-15T12_31_46_arena10.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 5 \n",
      "Experiment: video_2021-02-15T12_31_46_arena12.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 6 \n",
      "Experiment: video_2021-02-15T12_31_46_arena2.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 7 \n",
      "Experiment: video_2021-02-15T12_31_46_arena8.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 8 \n",
      "Experiment: video_2021-02-16T10_30_25_arena15.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 9 \n",
      "Experiment: video_2021-02-16T10_30_25_arena2.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 10 \n",
      "Experiment: video_2021-02-16T10_30_25_arena9.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 11 \n",
      "Experiment: video_2021-02-16T11_24_30_arena12.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 12 \n",
      "Experiment: video_2021-02-16T11_24_30_arena15.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 13 \n",
      "Experiment: video_2021-02-16T11_24_30_arena6.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 14 \n",
      "Experiment: video_2021-02-17T11_53_24_arena14.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 15 \n",
      "Experiment: video_2021-02-17T11_53_24_arena3.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 16 \n",
      "Experiment: video_2021-02-17T11_53_24_arena5.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 17 \n",
      "Experiment: video_2021-02-17T11_53_24_arena7.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 18 \n",
      "Experiment: video_2021-02-17T11_53_24_arena9.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 19 \n",
      "Experiment: video_2021-02-17T12_30_11_arena11.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 20 \n",
      "Experiment: video_2021-02-17T12_30_11_arena2.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 21 \n",
      "Experiment: video_2021-02-17T12_30_11_arena3.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 22 \n",
      "Experiment: video_2021-02-17T12_30_11_arena9.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 23 \n",
      "Experiment: video_2021-02-18T10_30_35_arena11.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 24 \n",
      "Experiment: video_2021-02-18T10_30_35_arena12.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 25 \n",
      "Experiment: video_2021-02-18T10_30_35_arena15.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 26 \n",
      "Experiment: video_2021-02-18T10_30_35_arena2.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 27 \n",
      "Experiment: video_2021-02-18T10_30_35_arena6.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 28 \n",
      "Experiment: video_2021-02-19T12_26_51_arena1.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 29 \n",
      "Experiment: video_2021-02-19T12_26_51_arena10.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 30 \n",
      "Experiment: video_2021-02-19T12_26_51_arena12.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 31 \n",
      "Experiment: video_2021-02-19T12_26_51_arena16.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 32 \n",
      "Experiment: video_2021-02-19T12_26_51_arena3.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 33 \n",
      "Experiment: video_2021-02-19T12_26_51_arena7.csv \n",
      "Condition: test \n",
      "\n",
      "Iteration: 34 \n",
      "Experiment: video_2021-02-19T12_26_51_arena9.csv \n",
      "Condition: test \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>has_aggression</th>\n",
       "      <th>aggression_latency</th>\n",
       "      <th>aggression_latency_mins</th>\n",
       "      <th>nframes</th>\n",
       "      <th>nbouts</th>\n",
       "      <th>ratio_frames</th>\n",
       "      <th>ratio_bouts</th>\n",
       "      <th>condition</th>\n",
       "      <th>experiment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>True</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>0.557500</td>\n",
       "      <td>609</td>\n",
       "      <td>6</td>\n",
       "      <td>0.033833</td>\n",
       "      <td>1.2</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena3.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>True</td>\n",
       "      <td>902.0</td>\n",
       "      <td>0.250556</td>\n",
       "      <td>443</td>\n",
       "      <td>7</td>\n",
       "      <td>0.024611</td>\n",
       "      <td>1.4</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena4.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>True</td>\n",
       "      <td>3789.0</td>\n",
       "      <td>1.052500</td>\n",
       "      <td>311</td>\n",
       "      <td>9</td>\n",
       "      <td>0.017278</td>\n",
       "      <td>1.8</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena6.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>True</td>\n",
       "      <td>2491.0</td>\n",
       "      <td>0.691944</td>\n",
       "      <td>438</td>\n",
       "      <td>12</td>\n",
       "      <td>0.024333</td>\n",
       "      <td>2.4</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena8.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>True</td>\n",
       "      <td>4246.0</td>\n",
       "      <td>1.179444</td>\n",
       "      <td>110</td>\n",
       "      <td>10</td>\n",
       "      <td>0.006111</td>\n",
       "      <td>2.0</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T12_31_46_arena4.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>True</td>\n",
       "      <td>2608.0</td>\n",
       "      <td>0.724444</td>\n",
       "      <td>219</td>\n",
       "      <td>4</td>\n",
       "      <td>0.012167</td>\n",
       "      <td>0.8</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena12.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>True</td>\n",
       "      <td>4727.0</td>\n",
       "      <td>1.313056</td>\n",
       "      <td>102</td>\n",
       "      <td>7</td>\n",
       "      <td>0.005667</td>\n",
       "      <td>1.4</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena16.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>True</td>\n",
       "      <td>3404.0</td>\n",
       "      <td>0.945556</td>\n",
       "      <td>59</td>\n",
       "      <td>6</td>\n",
       "      <td>0.003278</td>\n",
       "      <td>1.2</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena3.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>True</td>\n",
       "      <td>2285.0</td>\n",
       "      <td>0.634722</td>\n",
       "      <td>16</td>\n",
       "      <td>5</td>\n",
       "      <td>0.000889</td>\n",
       "      <td>1.0</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena7.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>True</td>\n",
       "      <td>2208.0</td>\n",
       "      <td>0.613333</td>\n",
       "      <td>163</td>\n",
       "      <td>4</td>\n",
       "      <td>0.009056</td>\n",
       "      <td>0.8</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena9.csv</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>93 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    has_aggression  aggression_latency  aggression_latency_mins  nframes  \\\n",
       "0             True              2007.0                 0.557500      609   \n",
       "1             True               902.0                 0.250556      443   \n",
       "2             True              3789.0                 1.052500      311   \n",
       "3             True              2491.0                 0.691944      438   \n",
       "4             True              4246.0                 1.179444      110   \n",
       "..             ...                 ...                      ...      ...   \n",
       "88            True              2608.0                 0.724444      219   \n",
       "89            True              4727.0                 1.313056      102   \n",
       "90            True              3404.0                 0.945556       59   \n",
       "91            True              2285.0                 0.634722       16   \n",
       "92            True              2208.0                 0.613333      163   \n",
       "\n",
       "    nbouts  ratio_frames  ratio_bouts     condition  \\\n",
       "0        6      0.033833          1.2  gal4_control   \n",
       "1        7      0.024611          1.4  gal4_control   \n",
       "2        9      0.017278          1.8  gal4_control   \n",
       "3       12      0.024333          2.4  gal4_control   \n",
       "4       10      0.006111          2.0  gal4_control   \n",
       "..     ...           ...          ...           ...   \n",
       "88       4      0.012167          0.8          test   \n",
       "89       7      0.005667          1.4          test   \n",
       "90       6      0.003278          1.2          test   \n",
       "91       5      0.000889          1.0          test   \n",
       "92       4      0.009056          0.8          test   \n",
       "\n",
       "                               experiment  \n",
       "0    video_2021-02-15T11_52_18_arena3.csv  \n",
       "1    video_2021-02-15T11_52_18_arena4.csv  \n",
       "2    video_2021-02-15T11_52_18_arena6.csv  \n",
       "3    video_2021-02-15T11_52_18_arena8.csv  \n",
       "4    video_2021-02-15T12_31_46_arena4.csv  \n",
       "..                                    ...  \n",
       "88  video_2021-02-19T12_26_51_arena12.csv  \n",
       "89  video_2021-02-19T12_26_51_arena16.csv  \n",
       "90   video_2021-02-19T12_26_51_arena3.csv  \n",
       "91   video_2021-02-19T12_26_51_arena7.csv  \n",
       "92   video_2021-02-19T12_26_51_arena9.csv  \n",
       "\n",
       "[93 rows x 9 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "aggression_df = pd.DataFrame()\n",
    "for condition in condition_order:\n",
    "    for h, experiment_path in enumerate(experiments[condition]):\n",
    "\n",
    "        experiment = os.path.basename(experiment_path)\n",
    "        \n",
    "        print('Iteration:', h, '\\nExperiment:', experiment, '\\nCondition:', condition, '\\n')\n",
    "        \n",
    "        # Exclude experiments without copulation (since aggression is only observed during copulation).\n",
    "        annotation_video = annotations.read(experiment_path)\n",
    "        try:\n",
    "            copulation = annotation_video[0].events[0]\n",
    "        except IndexError:\n",
    "            continue\n",
    "        \n",
    "        aggression_events = list(filter(lambda event: event.time < (copulation.time + N_FRAMES), annotation_video[1].events)) # Consider aggression only during the first 5 minutes of copulation.\n",
    "        n_events = len(aggression_events)\n",
    "\n",
    "        # In case there is aggression, do the necessary calculations.\n",
    "        if n_events > 0:\n",
    "            aggression_latency =  aggression_events[0].time - copulation.time\n",
    "            aggression_latency_mins = aggression_latency / (60 * FPS)\n",
    "            ratio_frames = sum([aggression.duration for aggression in aggression_events]) / N_FRAMES\n",
    "            ratio_bouts = n_events / N_MINUTES\n",
    "\n",
    "            aggression_data = pd.DataFrame({'has_aggression': True,\n",
    "                                            'aggression_latency': aggression_latency,\n",
    "                                            'aggression_latency_mins': aggression_latency_mins,\n",
    "                                            'nframes': sum([aggression.duration for aggression in aggression_events]),\n",
    "                                            'nbouts': n_events,\n",
    "                                            'ratio_frames': ratio_frames,\n",
    "                                            'ratio_bouts': ratio_bouts,\n",
    "                                            'condition': condition,\n",
    "                                            'experiment': experiment},\n",
    "                                            index=[h],\n",
    "                                           )\n",
    "\n",
    "        # If not, preset our dictionary with default values.\n",
    "        else:\n",
    "            aggression_data = pd.DataFrame({'has_aggression': False,\n",
    "                                            'aggression_latency': np.nan,\n",
    "                                            'aggression_latency_mins': 0,\n",
    "                                            'nframes': 0,\n",
    "                                            'nbouts': 0,\n",
    "                                            'ratio_frames': 0, \n",
    "                                            'ratio_bouts': 0,\n",
    "                                            'condition': condition,\n",
    "                                            'experiment': experiment},\n",
    "                                            index=[h],\n",
    "                                           )\n",
    "        \n",
    "        # Concatenate all data together.\n",
    "        aggression_df = pd.concat([aggression_df, aggression_data], ignore_index=True)\n",
    "\n",
    "aggression_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Outlier Detection"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\t gal4_control \n",
      "\n",
      "[5, 33]\n",
      "Number data points considered outliers: 2\n",
      "Percent data points considered outliers: 5.556 %\n",
      "\n",
      "\t uas_control \n",
      "\n",
      "[56]\n",
      "Number data points considered outliers: 1\n",
      "Percent data points considered outliers: 4.545 %\n",
      "\n",
      "\t test \n",
      "\n",
      "[65]\n",
      "Number data points considered outliers: 1\n",
      "Percent data points considered outliers: 2.857 %\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>has_aggression</th>\n",
       "      <th>aggression_latency</th>\n",
       "      <th>aggression_latency_mins</th>\n",
       "      <th>nframes</th>\n",
       "      <th>nbouts</th>\n",
       "      <th>ratio_frames</th>\n",
       "      <th>ratio_bouts</th>\n",
       "      <th>condition</th>\n",
       "      <th>experiment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>True</td>\n",
       "      <td>2007.0</td>\n",
       "      <td>0.557500</td>\n",
       "      <td>609</td>\n",
       "      <td>6</td>\n",
       "      <td>0.033833</td>\n",
       "      <td>1.2</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena3.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>True</td>\n",
       "      <td>902.0</td>\n",
       "      <td>0.250556</td>\n",
       "      <td>443</td>\n",
       "      <td>7</td>\n",
       "      <td>0.024611</td>\n",
       "      <td>1.4</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena4.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>True</td>\n",
       "      <td>3789.0</td>\n",
       "      <td>1.052500</td>\n",
       "      <td>311</td>\n",
       "      <td>9</td>\n",
       "      <td>0.017278</td>\n",
       "      <td>1.8</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena6.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>True</td>\n",
       "      <td>2491.0</td>\n",
       "      <td>0.691944</td>\n",
       "      <td>438</td>\n",
       "      <td>12</td>\n",
       "      <td>0.024333</td>\n",
       "      <td>2.4</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T11_52_18_arena8.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>True</td>\n",
       "      <td>4246.0</td>\n",
       "      <td>1.179444</td>\n",
       "      <td>110</td>\n",
       "      <td>10</td>\n",
       "      <td>0.006111</td>\n",
       "      <td>2.0</td>\n",
       "      <td>gal4_control</td>\n",
       "      <td>video_2021-02-15T12_31_46_arena4.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>True</td>\n",
       "      <td>2608.0</td>\n",
       "      <td>0.724444</td>\n",
       "      <td>219</td>\n",
       "      <td>4</td>\n",
       "      <td>0.012167</td>\n",
       "      <td>0.8</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena12.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>True</td>\n",
       "      <td>4727.0</td>\n",
       "      <td>1.313056</td>\n",
       "      <td>102</td>\n",
       "      <td>7</td>\n",
       "      <td>0.005667</td>\n",
       "      <td>1.4</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena16.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>True</td>\n",
       "      <td>3404.0</td>\n",
       "      <td>0.945556</td>\n",
       "      <td>59</td>\n",
       "      <td>6</td>\n",
       "      <td>0.003278</td>\n",
       "      <td>1.2</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena3.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>True</td>\n",
       "      <td>2285.0</td>\n",
       "      <td>0.634722</td>\n",
       "      <td>16</td>\n",
       "      <td>5</td>\n",
       "      <td>0.000889</td>\n",
       "      <td>1.0</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena7.csv</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>True</td>\n",
       "      <td>2208.0</td>\n",
       "      <td>0.613333</td>\n",
       "      <td>163</td>\n",
       "      <td>4</td>\n",
       "      <td>0.009056</td>\n",
       "      <td>0.8</td>\n",
       "      <td>test</td>\n",
       "      <td>video_2021-02-19T12_26_51_arena9.csv</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>89 rows × 9 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "    has_aggression  aggression_latency  aggression_latency_mins  nframes  \\\n",
       "0             True              2007.0                 0.557500      609   \n",
       "1             True               902.0                 0.250556      443   \n",
       "2             True              3789.0                 1.052500      311   \n",
       "3             True              2491.0                 0.691944      438   \n",
       "4             True              4246.0                 1.179444      110   \n",
       "..             ...                 ...                      ...      ...   \n",
       "88            True              2608.0                 0.724444      219   \n",
       "89            True              4727.0                 1.313056      102   \n",
       "90            True              3404.0                 0.945556       59   \n",
       "91            True              2285.0                 0.634722       16   \n",
       "92            True              2208.0                 0.613333      163   \n",
       "\n",
       "    nbouts  ratio_frames  ratio_bouts     condition  \\\n",
       "0        6      0.033833          1.2  gal4_control   \n",
       "1        7      0.024611          1.4  gal4_control   \n",
       "2        9      0.017278          1.8  gal4_control   \n",
       "3       12      0.024333          2.4  gal4_control   \n",
       "4       10      0.006111          2.0  gal4_control   \n",
       "..     ...           ...          ...           ...   \n",
       "88       4      0.012167          0.8          test   \n",
       "89       7      0.005667          1.4          test   \n",
       "90       6      0.003278          1.2          test   \n",
       "91       5      0.000889          1.0          test   \n",
       "92       4      0.009056          0.8          test   \n",
       "\n",
       "                               experiment  \n",
       "0    video_2021-02-15T11_52_18_arena3.csv  \n",
       "1    video_2021-02-15T11_52_18_arena4.csv  \n",
       "2    video_2021-02-15T11_52_18_arena6.csv  \n",
       "3    video_2021-02-15T11_52_18_arena8.csv  \n",
       "4    video_2021-02-15T12_31_46_arena4.csv  \n",
       "..                                    ...  \n",
       "88  video_2021-02-19T12_26_51_arena12.csv  \n",
       "89  video_2021-02-19T12_26_51_arena16.csv  \n",
       "90   video_2021-02-19T12_26_51_arena3.csv  \n",
       "91   video_2021-02-19T12_26_51_arena7.csv  \n",
       "92   video_2021-02-19T12_26_51_arena9.csv  \n",
       "\n",
       "[89 rows x 9 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "corrected_ratio_frames = pd.DataFrame()\n",
    "\n",
    "for condition in condition_order:\n",
    "\n",
    "    print('\\n\\t', condition, '\\n')\n",
    "\n",
    "    try:\n",
    "        dataset = aggression_df.query('condition==\"' + condition + '\"')['ratio_frames']\n",
    "\n",
    "        outlier_positions = helpers.check_outliers(dataset)\n",
    "        print(outlier_positions)\n",
    "\n",
    "        fresh_dataset = pd.DataFrame(helpers.remove_outliers(dataset, indices=outlier_positions))\n",
    "        fresh_dataset['condition'] = condition\n",
    "\n",
    "        corrected_ratio_frames = pd.concat([corrected_ratio_frames, fresh_dataset], axis=0)\n",
    "        \n",
    "    except ValueError as error:\n",
    "        print(error)\n",
    "\n",
    "aggression_df = aggression_df.loc[corrected_ratio_frames.index]\n",
    "aggression_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Aggression Bouts / Min."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>condition</th>\n",
       "      <th>ratio_bouts</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>gal4_control</td>\n",
       "      <td>1.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>gal4_control</td>\n",
       "      <td>1.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>gal4_control</td>\n",
       "      <td>1.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>gal4_control</td>\n",
       "      <td>2.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>gal4_control</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>test</td>\n",
       "      <td>0.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>test</td>\n",
       "      <td>1.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>test</td>\n",
       "      <td>1.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>test</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>test</td>\n",
       "      <td>0.8</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>89 rows × 2 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       condition  ratio_bouts\n",
       "0   gal4_control          1.2\n",
       "1   gal4_control          1.4\n",
       "2   gal4_control          1.8\n",
       "3   gal4_control          2.4\n",
       "4   gal4_control          2.0\n",
       "..           ...          ...\n",
       "88          test          0.8\n",
       "89          test          1.4\n",
       "90          test          1.2\n",
       "91          test          1.0\n",
       "92          test          0.8\n",
       "\n",
       "[89 rows x 2 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ratio_bouts_df = aggression_df.copy()[['condition', 'ratio_bouts']]\n",
    "ratio_bouts_df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Statistics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "\t gal4_control \n",
      "\n",
      "Shapiro's Test: group 1 IS normally distributed.\n",
      "D'Agostino's Test: group 1 IS normally distributed.\n",
      "Shapiro's Test: group 2 IS NOT normally distributed.\n",
      "D'Agostino's Test: group 2 IS NOT normally distributed.\n",
      "Levene's Test for non-normally distributed samples:\n",
      "  p-value = 0.033273\n",
      "  All groups were sampled from populations with NOT IDENTICAL variances.\n",
      "\n",
      "Mann-Whitney p-value: 0.004266837779802747 \n",
      "\n",
      "\n",
      "\t uas_control \n",
      "\n",
      "Shapiro's Test: group 1 IS normally distributed.\n",
      "D'Agostino's Test: group 1 IS normally distributed.\n",
      "Shapiro's Test: group 2 IS NOT normally distributed.\n",
      "D'Agostino's Test: group 2 IS NOT normally distributed.\n",
      "Levene's Test for non-normally distributed samples:\n",
      "  p-value = 0.265927\n",
      "  All groups were sampled from populations with IDENTICAL variances.\n",
      "\n",
      "Mann-Whitney p-value: 0.00029956833412599315 \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'gal4_control': 0.004266837779802747, 'uas_control': 0.00029956833412599315}"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ratio_bouts_pvalues = {}\n",
    "\n",
    "test = ratio_bouts_df.query('condition==\"test\"')['ratio_bouts']\n",
    "\n",
    "for condition in condition_order[:-1]:\n",
    "        \n",
    "    print('\\n\\t', condition, '\\n')\n",
    "\n",
    "    try:\n",
    "        control = ratio_bouts_df.query('condition==\"' + condition + '\"')['ratio_bouts']\n",
    "\n",
    "        temp_values = {'control': control, 'test': test}\n",
    "\n",
    "        pvalue_condition = helpers.run_statistics(temp_values)\n",
    "\n",
    "        ratio_bouts_pvalues[condition] = pvalue_condition\n",
    "        \n",
    "    except ValueError as error:\n",
    "        print(error)\n",
    "    \n",
    "ratio_bouts_pvalues"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Bonferroni Correction\n",
      "---------------------\n",
      "\n",
      "\tOriginal Values:\n",
      " {'gal4_control': 0.004266837779802747, 'uas_control': 0.00029956833412599315}\n",
      "\n",
      "\tCorrected Values:\n",
      " {'gal4_control': 0.008533675559605493, 'uas_control': 0.0005991366682519863} \n",
      "\n"
     ]
    }
   ],
   "source": [
    "# Bonferroni corretction for multiple comparisons.\n",
    "title = 'Bonferroni Correction'\n",
    "print(title)\n",
    "print('-'*len(title))\n",
    "\n",
    "# Show uncorrected values.\n",
    "print('\\n\\tOriginal Values:\\n', ratio_bouts_pvalues)\n",
    "\n",
    "# Apply the bonferroni correction for multiple comparisons.\n",
    "ratio_bouts_multi_comp_correction = multipletests(pvals=list(ratio_bouts_pvalues.values()), alpha=0.05, method='bonferroni')[1]\n",
    "\n",
    "# Transform the correction results into a dictionary.\n",
    "corrected_ratio_bouts_pvalues = dict(zip(list(ratio_bouts_pvalues.keys()), ratio_bouts_multi_comp_correction))\n",
    "\n",
    "# Show corrected values.\n",
    "print('\\n\\tCorrected Values:\\n', corrected_ratio_bouts_pvalues, '\\n')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Effect Size"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "gal4_control\n",
      "Small Effect: -0.38461538461538447 \n",
      "\n",
      "uas_control\n",
      "Medium Effect: -0.5 \n",
      "\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'gal4_control': -0.38461538461538447, 'uas_control': -0.5}"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ratio_bouts_sizes = {}\n",
    "\n",
    "test = ratio_bouts_df.query('condition==\"test\"')['ratio_bouts']\n",
    "\n",
    "for condition in condition_order[:-1]:\n",
    "\n",
    "    print(condition)\n",
    "    \n",
    "    control = ratio_bouts_df.query('condition==\"' + condition + '\"')['ratio_bouts']\n",
    "\n",
    "    median_diff = helpers.get_effect_size(control, test, method='median_diff')\n",
    "    \n",
    "    ratio_bouts_sizes[condition] = median_diff\n",
    "    \n",
    "ratio_bouts_sizes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Plot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAP4AAAEgCAYAAACU1c66AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAgAElEQVR4nOydd3RU1RaHv2mZVFIpCSQk9BJ6EULvUpQuSEdFURTlKXaK+nzYRaVbQKnSpfeqBqRISaghhISQ3stk6n1/DA4ESBgwk5mQ8611F8yee+f+zp3ZOW2ffWSSJEkIBIJyhdzeAgQCQekjHF8gKIcIxxcIyiHC8QWCcohwfIGgHCIcXyAoh5Sq42/cuBEPD4/SvKVAILgHstKax798+TK9e/cmMTGR3Nzc0rilQCAoglKp8fPz8xk1ahRfffVVadxOIBDch1Jx/BdeeIEXXniBxo0bl8btBALBfbC548+bNw+lUskzzzxz33NnzpyJTCazHAKBwDbYvI/funVr8vPzUSqV6HQ6Ll68SKNGjdi2bRsBAQFFC5PJEMsIBALbUGqDewAxMTGEhoZaNbgnHF8gsB1iHl8gKIeUao3/IIgaXyCwHaLGFwjKIcLxBYJyiHB8gaAcIhxfICiHCM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xInPmAxx4jMmQ5z4jMkQJz5jMvQPd6jM0hD1ep0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 270x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Initialize figure.\n",
    "n_conditions = ratio_bouts_df['condition'].nunique()\n",
    "figure, axis = plt.subplots(figsize=(1.25*n_conditions, 4))\n",
    "\n",
    "# Draw the boxplot.\n",
    "sns.boxplot(x='condition',\n",
    "            y='ratio_bouts',\n",
    "            data=ratio_bouts_df,\n",
    "            order=condition_order,\n",
    "            width=0.6,\n",
    "            showfliers=False,\n",
    "            palette=['#a3b18a', '#a3b18a', '#004b23'],\n",
    "            boxprops={'edgecolor': INK},\n",
    "            medianprops={'color': INK},\n",
    "            whiskerprops={'color': INK},\n",
    "            capprops={'color': INK}\n",
    "           )\n",
    "\n",
    "# Draw the swarmplot.\n",
    "sns.swarmplot(x='condition',\n",
    "              y='ratio_bouts',\n",
    "              data=ratio_bouts_df,\n",
    "              order=condition_order,\n",
    "              palette=['#a3b18a', '#a3b18a', '#004b23'],\n",
    "              linewidth=0.75,\n",
    "              edgecolor=INK\n",
    "             )\n",
    "\n",
    "# Figure and axes formatting.\n",
    "axis.set_xlabel('')\n",
    "axis.set_xticklabels([''])\n",
    "axis.set_ylabel('# Bouts / Minute of Copulation')\n",
    "axis.set_ylim(0, 4)\n",
    "axis.set_yticks(np.arange(0, 4+1, 1))\n",
    "axis.set_yticklabels([round(label, 1) for label in axis.get_yticks()])\n",
    "\n",
    "# Table definition.\n",
    "row1 = [str(ratio_bouts_df.query('condition==\"'+condition+'\"').shape[0]) for condition in condition_order]\n",
    "row2 = ['OR47b-GAL4;\\n+', '+;\\nUAS-Kir', 'OR47b-GAL4;\\nUAS-Kir']\n",
    "cell_text = np.array([row1, row2])\n",
    "\n",
    "row_labels = ['n =', '']\n",
    "summary_table = axis.table(cellText= cell_text,\n",
    "                           cellLoc='center',\n",
    "                           rowLabels=row_labels,\n",
    "                           rowLoc='center',\n",
    "                           colLoc='center'\n",
    "                          )\n",
    "\n",
    "summary_table.auto_set_font_size(False)\n",
    "summary_table.set_fontsize(11)\n",
    "\n",
    "properties = summary_table.properties()\n",
    "table_cells = properties['children']\n",
    "for cell in table_cells:\n",
    "    cell.set_height(0.12)\n",
    "    cell.set_alpha(0)\n",
    "\n",
    "# Draw statistical results.\n",
    "for p, condition in enumerate(condition_order[:-1]):\n",
    "    sig_height = 6 if (corrected_ratio_bouts_pvalues.get(condition, 'NaN') == 'NaN') or (corrected_ratio_bouts_pvalues.get(condition, 'NaN') >= 0.05) else 2\n",
    "    helpers.plot_stattest_result(ax=axis,\n",
    "                                 x1=p,\n",
    "                                 x2=p,\n",
    "                                 p_value=corrected_ratio_bouts_pvalues.get(condition, 'NaN'),\n",
    "                                 y=3.6,\n",
    "                                 ticksize=0,\n",
    "                                 xytext=(0,sig_height),\n",
    "                                 fontsize=13,\n",
    "                                 color=INK,\n",
    "                                 connector_color=INK\n",
    "                                )\n",
    "\n",
    "# Saving parameters.\n",
    "filename = 'nbouts_aggression_normalized_5mins_Or47b'\n",
    "plt.savefig(os.path.join(savepath, filename))\n",
    "\n",
    "plt.show()\n",
    "plt.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
